package com.jerry.springcloud.service;

import com.jerry.springcloud.entity.CommonResult;
import com.jerry.springcloud.entity.Payment;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

@Component
@FeignClient(value = "PROVIDER-PAYMENT", fallback = PaymentFallbackService.class)
public interface PaymentFeignService {

    @GetMapping("/payment/create")
    CommonResult create(Payment payment);

    @GetMapping("/payment/get/{id}")
    CommonResult getPaymentById(@PathVariable("id") Long id);

    @GetMapping("/payment/get")
    CommonResult getPaymentList();

    @GetMapping("/payment/hystrix/ok/{id}")
    String paymentInfo_OK(@PathVariable("id") Long id);

    @GetMapping("/payment/hystrix/timeout/{id}")
    String paymentInfo_Timeout(@PathVariable("id") Long id);

    @GetMapping("/payment/hystrix/error/{id}")
    String paymentInfo_Error(@PathVariable("id") Long id);

    @GetMapping("/payment/hystrix/circuitBreaker/{id}")
    public String paymentInfo_CircuitBreaker(@PathVariable("id") Long id);

    @GetMapping("/payment/zipkin")
    public String paymentInfo_zipkin();

}
